<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>异常交易信息</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author">
<link href="${request.getContextPath()}/Public/assets/admin/css/css.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css"
	rel="stylesheet" type="text/css">

<link
	href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css"
	id="style_components" rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/plugins.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/layout.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css"
	rel="stylesheet" type="text/css" id="style_color">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/custom.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css"
	href="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.css" />
<link
	href="${request.getContextPath()}/Public/assets/admin/css/common.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/kkpager.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/fancybox/source/jquery.fancybox.css"
	rel="stylesheet" type="text/css" />
<link rel="shortcut icon"
	href="${request.getContextPath()}/Public/favicon.ico">

<!-- select2控件样式 -->
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/select2/select2.css"
	rel="stylesheet" type="text/css">

<!-- 时间插件 -->
<link
	href="${request.getContextPath()}/Public/js/jqueryUI/css/jquery-ui.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/js/jqueryUI/css/jquery-ui-timepicker-addon.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/js/jqueryUI/css/jquery.datetimepicker.css"
	rel="stylesheet" type="text/css">
<!-- pandora-dialog 弹层组件样式 -->
<link
	href="${request.getContextPath()}/Public/js/pandora/css/dialog.css"
	rel="stylesheet" type="text/css">
	
<script>
	BASE_URL = '${request.getContextPath()}'
</script>
<style type="text/css">

.nav> li > a {
    text-shadow: none;
    color: red;
    font-size: 22px;
}
.datepicker {
	font-size: 16px;
}

.datepicker td, .datepicker th {
	width: 14.28571428571429%;
	height: 40px;
}

.table-condensed {
	width: 100%;
}

.datepicker-inline {
	width: 100%;
}

.col-md-4, .col-md-6, .col-md-7, .col-md-12 {
	padding-right: 0px;
	padding-left: 0px;
}

.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
	.table>thead>tr>td, .table>thead>tr>th {
	border-bottom: 1px solid #ddd;
}
.input-inline {
    display: inline-block;
    width: 315px;
    vertical-align: middle;
}

.dialog-confirm {
	padding: 20px;
	font-size: 25px;
	text-align: center;
	color: rgb(253, 8, 8);
}

.dialog-footer {
	text-align: center;
}

.dialog-body .dialog-content {
	padding: 20px;
	width: 100%;
	height: 100%;
	text-align: center;
	color: rgb(253, 8, 8);
	font-size: 25px;
}



</style>

</head>
<body class="page-header-top-fixed page-footer-fixed">
	<!--头部信息结束 -->
	<div class="page-header">
		<!--头部开始-->
		<#include "/include/top.html" />
		<!-- 头部信息结束 -->
	</div>
	
	<!-- BEGIN PAGE CONTAINER -->
	<div class="page-container">
		<#include "/include/menu.html" />
		<div class="page-content-wrapper">
			<div class="page-content">
				<div class="container-fluid">
					<div class="row">
					<div class="col-md-12">
						<div class="portlet light " style="margin-top: 5px;">
							<div class="portlet-body">
									<div class="row" style="height: 56px; text-align:right ;padding-left: 3px;">
										<div class="col-sm-12">
											<div id="sample_2_filter" class="dataTables_filter">
												<form action="${request.getContextPath()}/sysManager/unusualTransactionList.do" method="post" id="myForm">
													
													</label>
													<label>操作日期:<input type="search"
														class="form-control input-small2 input-inline inTimePicker" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
														placeholder="开始时间" name="startTime" id="startTime"
														value="${startTime!''}"
														>
													</label> - 
													<label><input type="search"
														class="form-control input-small2 input-inline inTimePicker" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
														placeholder="结束时间" name="endTime" id="endTime"
														value="${endTime!''}"
														>
													</label>
													<input type="hidden" value="" name="userIds" id="userIds">
													<button  class="btn red"  type="submit" >
														<i class="fa fa-search"></i> 查询
													</button>
													<!-- <button  class="btn red"  type="submit" >
														<i class="fa fa-print"></i> 打印
													</button> -->
												</form>
											</div>
										</div>
									</div>
									<table class="table table-striped table-bordered table-hover">
									<thead>
									<tr>
										<th>
											错误时间
										</th>
										<th>
											异常说明
										</th>
										<th>
											交易编号
										</th>
										<th>
											企业名称
										</th>
										<th>
											企业账号
										</th>
										<th>
											交易动作
										</th>
										<th>
											金额
										</th>
										<th>
											系统可用余额
										</th>
										<th>
											中信可用余额
										</th>
										<th>
											操作
										</th>
									</tr>
									</thead>
									<tbody>
										<#if moneyExceptionList ??>
											<#list moneyExceptionList as moneyException>
												<tr>
														<td>
															${moneyException.createTime!'--'}
														</td>
														<td>
															余额不符
														</td>
														<td>
															${moneyException.paymentNo}
														</td>
														<td>${moneyException.userCompanyName!'--'}</td>
														<td>${moneyException.userAccountNo!'--'}</td>
														<td>
															<#if moneyException.operate == 1>
																支付冻结
															<#elseif  moneyException.operate == 2>
																查询余额
															<#elseif  moneyException.operate == 3>
																每日结算
															<#elseif  moneyException.operate == 4>
																出金
															<#else>
																其他
															</#if>
														</td>
														<td>
															<#if moneyException.operate == 4>
																--
															<#elseif moneyException.dealMoney ??>
																${moneyException.dealMoney?string(',###.##')}
															<#else>
																0.00
															</#if>
														</td>
														<!-- 系统可用余额 -->
														<td>
															<#if moneyException.userMoney ??>
																${moneyException.userMoney?string(',###.##')}
															<#else>
																0.00
															</#if>
														</td>
														<!-- 中信可用余额 -->
														<td>
															<#if moneyException.userPayChannelMoney ??>
																${moneyException.userPayChannelMoney?string(',###.##')}
															<#else>
																0.00
															</#if>
														</td>
														<td>
															<#if moneyException.auditStatus == 0>
																<a href="#" class="daichuli" href="javascript:void(0);" moneyExceptionId="${moneyException.id!''}">
																<p style="color: red; font-weight: bolder;">待处理</p></a>
															<#elseif  moneyException.auditStatus == 1>
																已处理
															</#if>
														</td>
												</tr>
											</#list>											
										</#if>
									</tbody>
									</table>
									<div style="width: 80%; margin: 0 auto;">
										<div id="kkpager">
											<input type="hidden" value="${totalPage!''}" id="totalPage">
											<input type="hidden" value="${totalRecords!''}" id="totalRecords">
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- END PAGE CONTAINER -->
	<!-- 底部开始 -->
	<#include "/include/foot.html" />
	<!-- 底部结束 -->
</body>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/jquery.sparkline.min.js"
	type="text/javascript"></script>

<!-- <script
	src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker-index.js"
	type="text/javascript"></script> -->
<!-- 时间插件 -->
<script
	src="${request.getContextPath()}/Public/js/jqueryUI/jquery.ui.custom.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/js/jqueryUI/jquery.ui.datepicker.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/js/jqueryUI/jquery.ui.datepicker-zh-CN.js"
	type="text/javascript"></script>


<script
	src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/highcharts.js"
	type="text/javascript"></script>
<script
	src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>
<script src="${request.getContextPath()}/Public/js/moment/moment.js"
	type="text/javascript"></script>

<!-- select2控件 -->
<script type="text/javascript"
	src="${request.getContextPath()}/Public/assets/global/plugins/select2/select2.js"></script>
<script type="text/javascript"
	src="${request.getContextPath()}/Public/assets/global/plugins/select2/select2_locale_zh-CN.js"></script>

<!-- layer web弹层组件-->
<script type="text/javascript"
	src="${request.getContextPath()}/Public/js/layer/layer.min.js"></script>

<!-- pandora-dialog 弹层组件 -->
<script type="text/javascript"
	src="${request.getContextPath()}/Public/js/pandora/pandora-dialog.js"></script>
<!-- 脚本代码 -->
<script type="text/javascript">
	$(function() {
		Metronic.init(); // init metronic core componets
		Layout.init(); // init layout
		
		//td th 内容居中
		$("th").css("text-align", "center");
		$("td").css("text-align", "center");
		
		//初始化分页插件	
		toPage();
	});

	//分页
	function toPage(){
		function getParameter(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if (r != null)
				return unescape(r[2]);
			return null;
		}
		
		var totalPage = $('#totalPage').val();
		var totalRecords = $('#totalRecords').val();
	
		var pageNo = getParameter('pno');
		if (!pageNo) {
			pageNo = 1;
		}
		
		//生成分页
		//有些参数是可选的，比如lang，若不传有默认值
		kkpager.generPageHtml({
			pno : pageNo,
			//总页码
			total : totalPage,
			//总数据条数
			totalRecords : totalRecords,
	
			getLink : function(n) {
				return this.hrefFormer + this.hrefLatter + "?pno=" +n+"&startTime="+$("#startTime").val()+"&endTime="+$("#endTime").val();
			}
		});
	}
	
	
	/* //开始时间
	$("#startTime").datepicker({
		changeYear: true,
		changeMonth: true,
		yearRange:"2015:2050",
		prevText: '<',
		nextText: '>',
		onSelect:function(dateText,inst){
			var endText=AddDays(dateText);
			$("#endTime").datepicker("option","minDate",dateText);
			$("#endTime").datepicker("option","maxDate",endText);
			$(this).focus();
			$(this).blur();
		}
	});
	
	//结束时间 
	$("#endTime").datepicker({
		changeYear: true,
		changeMonth: true,
		yearRange:"2015:2050",
		prevText: '<',
		nextText: '>',
		beforeShow: function() {
			var query=$("#startTime").val();
			var dateText=AddDays(query);
			$("#endTime").datepicker("option","maxDate",dateText);
		},
		onSelect:function(dateText,inst){
			$("#startTime").datepicker("option","maxDate",dateText);
			$(this).focus();
			$(this).blur();
		}
	}); */
	
	
	function AddDays(date){
		var nd = new Date(date);
		nd.setDate(nd.getDate()+36500);//最长间隔多少天  
		var y = nd.getFullYear();
		var m = nd.getMonth()+1;
		var d = nd.getDate();
		if(m <= 9) m = "0"+m;
		if(d <= 9) d = "0"+d; 
		var cdate = y+""+m+""+d;
		return cdate;
	}
	
	//处理异常事件
	$("a.daichuli").bind("click",function(){
		var moneyExceptionId = $(this).attr("moneyExceptionId");
		//alert(moneyExceptionId);
		$.confirm("处理本条异常交易信息?", function () {
			$.ajax({
				url : "${request.getContextPath()}/sysManager/updateMoneyException.do",
				type : "post",
				dataType:'JSON',
				data:{"moneyExceptionId":moneyExceptionId},
				success : function(result) {
					 confirmAndRefresh(result);
				}
			});
		});
		return false;
 	});
	
	
	function confirmAndRefresh(result) {
		if (result.code == "success") {
			pandora.dialog({
				wrapClass : "dialog-mini",
				content : "处理成功",
				okValue : "确定",
				ok : function() {
					var path = getContextPath();
					//alert(path+"/sysManager/accountList.do");
					window.location.href = path+"/sysManager/unusualTransactionList.do";
				}
			});
			//window.location.href = "${request.getContextPath()}/sysManager/unusualTransactionList.do";
		} else {
			pandora.dialog({
				wrapClass : "dialog-mini",
				content : "处理失败",
				okValue : "确定",
				ok : function() {
					var path = getContextPath();
					//alert(path+"/sysManager/accountList.do");
					window.location.href = path+"/sysManager/unusualTransactionList.do";
				}
			});
		}
	}
	
	function getContextPath() {
	    var pathName = document.location.pathname;
	    var index = pathName.substr(1).indexOf("/");
	    var result = pathName.substr(0,index+1);
	    return result;
  	}
</script>
</html>